/* A Unix wc utility implemented by Flex */
%{
#include <stdio.h>

int chars = 0;
int lines = 0;
int words = 0;
%}

%%

[^ \n\t\r\f\v]+			{words++; chars+=strlen(yytext);}
\n									{chars++; lines++;}
.										{chars++;}

%%

int main(int argc, char **argv) {
	yylex();
	printf("words: %d\nlines: %d\nchars: %d\n", words, lines, chars);
	return 0;
}
